# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=spot
pkgver=0.4.0
pkgrel=1
pkgdesc="Native Spotify client for the GNOME desktop"
url="https://github.com/xou816/spot"
# s390x: incompatible with nix crate
arch="all !s390x"
license="MIT"
makedepends="
	alsa-lib-dev
	bash
	cargo
	curl-dev
	glib-dev
	gtk4.0-dev
	libadwaita-dev
	libhandy1-dev
	meson
	nghttp2-dev
	openssl-dev>3
	pulseaudio-dev
	"
subpackages="$pkgname-lang"
source="https://github.com/xou816/spot/archive/$pkgver/spot-$pkgver.tar.gz
	appdata.patch
	pulseaudio-backend-only.patch
	cargo-bump-libc-lfs64.patch
	"
options="net" # cargo fetch


build() {
	# NOTE: buildtype must be release!
	abuild-meson \
		-Doffline=false \
		--buildtype=release \
		. output
	meson compile -j ${JOBS:-0} -C output
}

check() {
	# Meson eats stdout/stderr, so run cargo directly.
	cargo test --locked
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
45b7b28250d6a3ccfd829984d5ee2f94fc8f052467cfa94403171d7c9fe803c65567759b3b01b86b8cc7a1d8cbdff64d99c82a72c34997192386ff9f51531d1d  spot-0.4.0.tar.gz
77b0abec9fbcbc7360f54ef5dcbaf68b636ce6ea442c0e2c9fed4c8359dfa4ef5af481f87eea83860bdfda12954c6858d5cc9c9999ca1cd1e17999e29f69a58e  appdata.patch
a99903b73dac50ce5bc8e70a1f932dc1861ffac03c372490f8a07fdb82ee219cfe502ee3739c9ac08935ce25f95af1a9e39422b16091fbabc02131d8fe95b390  pulseaudio-backend-only.patch
c59869cfe519e215e78f5b36a11df8ce33f8d88d6941cdf9dea3518a008f9478cc190a03e80c745e48d9ad0d6236fb35f74b8647b29134234825d67506a0a07b  cargo-bump-libc-lfs64.patch
"
